<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.3.9 发布, 新增独立 Xrepo C/C++ 包管理器</title>
    <meta name="description" content="xmake 是一个基于 Lua 的轻量级跨平台构建工具，使用 xmake.lua 维护项目构建，相比 makefile/CMakeLists.txt，配置语法更加简洁直观，对新手非常友好，短时间内就能快速入门，能够让用户把更多的精力集中在实际的项目开发上。在这个新版本中，我们重点改进了 xmake 的依赖包管理，...">

    
    <meta name="keywords" content="xmake,lua,C/C++,toolchains,xrepo,packages,vcpkg,conan,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2020/11/24/xmake-update-v2.3.9/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.3.9 发布, 新增独立 Xrepo C/C++ 包管理器</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2020-11-24
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/cn/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a-->
        <a href="/cn/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a>&nbsp;
    
        <!--a href="/tag/#xrepo" title="Tag: xrepo" rel="tag">xrepo</a-->
        <a href="/cn/tag/#xrepo" title="Tag: xrepo" rel="tag">xrepo</a>&nbsp;
    
        <!--a href="/tag/#packages" title="Tag: packages" rel="tag">packages</a-->
        <a href="/cn/tag/#packages" title="Tag: packages" rel="tag">packages</a>&nbsp;
    
        <!--a href="/tag/#vcpkg" title="Tag: vcpkg" rel="tag">vcpkg</a-->
        <a href="/cn/tag/#vcpkg" title="Tag: vcpkg" rel="tag">vcpkg</a>&nbsp;
    
        <!--a href="/tag/#conan" title="Tag: conan" rel="tag">conan</a-->
        <a href="/cn/tag/#conan" title="Tag: conan" rel="tag">conan</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p><a href="https://github.com/xmake-io/xmake">xmake</a> 是一个基于 Lua 的轻量级跨平台构建工具，使用 xmake.lua 维护项目构建，相比 makefile/CMakeLists.txt，配置语法更加简洁直观，对新手非常友好，短时间内就能快速入门，能够让用户把更多的精力集中在实际的项目开发上。</p>

<p>在这个新版本中，我们重点改进了 xmake 的依赖包管理，新增了 Archlinux 和 MSYS2/Mingw 下 的 pacman 包管理器支持，另外我们进一步丰富了 xmake 的官方包仓库 <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a>，新增了 50 多个常用的 C/C++ 包。</p>

<p>此外，我们新增了一个基于 xmake 的独立子命令：<a href="https://github.com/xmake-io/xrepo/">xrepo</a>，一个完整独立的跨平台 C/C++ 包管理器，便于用户更加方便的管理日常 C/C++ 包的安装和集成使用。</p>

<p>同时，我们还上线了 xrepo 的相关站点 <a href="https://xrepo.xmake.io">xrepo.xmake.io</a>，我们可以在上面快速查看 xrepo 的使用方式，以及 xmake-repo 官方仓库中每个包的支持情况和使用方式。</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">项目源码</a></li>
  <li><a href="https://xmake.io/#/zh-cn/">官方文档</a></li>
  <li><a href="https://xmake.io/#/zh-cn/about/course">入门课程</a></li>
  <li><a href="https://github.com/xmake-io/xrepo">Xrepo 命令</a></li>
</ul>

<h2 id="入门课程">入门课程</h2>

<p>近期，我们也上线了官方的 xmake 入门课程，<a href="https://xmake.io/#/zh-cn/about/course">Xmake 带你轻松构建 C/C++ 项目</a> 以边学边做实验的方式快速学习 xmake 的使用。</p>

<h2 id="新特性介绍">新特性介绍</h2>

<h3 id="xrepo-包管理器">Xrepo 包管理器</h3>

<p>xrepo 是一个基于 <a href="https://github.com/xmake-io/xmake">Xmake</a> 的跨平台 C/C++ 包管理器。</p>

<p>它基于 xmake 提供的运行时，但却是一个完整独立的包管理程序，相比 vcpkg/homebrew 此类包管理器，xrepo 能够同时提供更多平台和架构的 C/C++ 包。</p>

<p>并且还支持多版本语义选择，另外它还是一个去中心化的分布式仓库，不仅仅提供了官方的 <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> 仓库，还支持用户自建多个私有仓库。</p>

<p>同时，xrepo 也支持从 vcpkg/homebrew/conan 等第三方包管理器中安装包，并提供统一一致的库链接信息，方便与第三方项目的集成对接。</p>

<p>如果你想要了解更多，请参考：<a href="https://xrepo.xmake.io/#/zh-cn/getting_started">在线文档</a>, <a href="https://github.com/xmake-io/xrepo">Github</a> 以及 <a href="https://gitee.com/tboox/xrepo">Gitee</a></p>

<p><img src="https://xrepo.xmake.io/assets/img/xrepo.gif" alt="" /></p>

<h4 id="安装">安装</h4>

<p>我们只需要安装上 xmake 就可以使用 xrepo 命令，关于 xmake 的安装，我们可以看下：<a href="https://xmake.io/#/zh-cn/guide/installation">xmake 安装文档</a>。</p>

<h4 id="支持平台">支持平台</h4>

<ul>
  <li>Windows (x86, x64)</li>
  <li>macOS (i386, x86_64, arm64)</li>
  <li>Linux (i386, x86_64, cross-toolchains ..)</li>
  <li>*BSD (i386, x86_64)</li>
  <li>Android (x86, x86_64, armeabi, armeabi-v7a, arm64-v8a)</li>
  <li>iOS (armv7, armv7s, arm64, i386, x86_64)</li>
  <li>MSYS (i386, x86_64)</li>
  <li>MinGW (i386, x86_64, arm, arm64)</li>
  <li>Cross Toolchains</li>
</ul>

<h4 id="支持的包管理仓库">支持的包管理仓库</h4>

<ul>
  <li>官方自建仓库 <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> (tbox &gt;1.6.1)</li>
  <li><a href="https://xmake.io/#/zh-cn/package/remote_package?id=%e4%bd%bf%e7%94%a8%e8%87%aa%e5%bb%ba%e7%a7%81%e6%9c%89%e5%8c%85%e4%bb%93%e5%ba%93">用户自建仓库</a></li>
  <li>Conan (conan::openssl/1.1.1g)</li>
  <li>Vcpkg (vcpkg:ffmpeg)</li>
  <li>Homebrew/Linuxbrew (brew::pcre2/libpcre2-8)</li>
  <li>Pacman on archlinux/msys2 (pacman::libcurl)</li>
  <li>Clib (clib::clibs/bytes@0.0.4)</li>
  <li>Dub (dub::log 0.4.3)</li>
</ul>

<h4 id="分布式仓库支持">分布式仓库支持</h4>

<p>除了可以直接从官方仓库：<a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> 检索安装包之外，
我们还可以添加任意多个自建的仓库，甚至可以完全隔离外网，仅仅在公司内部网络维护私有包的安装集成。</p>

<p>只需要通过下面的命令，添加上自己的仓库地址：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> add-repo myrepo https://github.com/mygroup/myrepo
</span></code></pre>
</div>

<h4 id="独立安装-cc-包">独立安装 C/C++ 包</h4>

<p>各种安装方式一应俱全，支持语义版本、调试包、动态库、可配置参数，也支持各种第三方包管理中的 C/C++ 包安装。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install zlib tbox
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install "zlib 1.2.x"
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install "zlib &gt;=1.2.0"
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -p iphoneos -a arm64 zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -p android [--ndk=/xxx] zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -p mingw [--mingw=/xxx] zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -p cross --sdk=/xxx/arm-linux-musleabi-cross zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -m debug zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -k shared zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -f "vs_runtime=MD" zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install -f "regex=true,thread=true" boost
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install brew::zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install vcpkg::zlib
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install conan::zlib/1.2.11
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install pacman:libpng
</span><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install dub:log
</span></code></pre>
</div>

<h4 id="与-xmake-的工程无缝集成">与 xmake 的工程无缝集成</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"tbox &gt;1.6.1"</span><span class="p">,</span> <span class="s2">"libuv master"</span><span class="p">,</span> <span class="s2">"vcpkg::ffmpeg"</span><span class="p">,</span> <span class="s2">"brew::pcre2/libpcre2-8"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"conan::openssl/1.1.1g"</span><span class="p">,</span> <span class="p">{</span><span class="n">alias</span> <span class="o">=</span> <span class="s2">"openssl"</span><span class="p">,</span> <span class="n">optional</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="n">debug</span> <span class="o">=</span> <span class="kc">true</span><span class="p">})</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"tbox"</span><span class="p">,</span> <span class="s2">"libuv"</span><span class="p">,</span> <span class="s2">"vcpkg::ffmpeg"</span><span class="p">,</span> <span class="s2">"brew::pcre2/libpcre2-8"</span><span class="p">,</span> <span class="s2">"openssl"</span><span class="p">)</span>
</code></pre>
</div>

<p>下面是与 xmake 集成的整体架构和编译流程。</p>

<p><img src="https://xmake.io/assets/img/index/package_arch.png" width="650px" /></p>

<p>更多关于 xrepo 的使用方式，请参考文档：<a href="https://xrepo.xmake.io/#/zh-cn/getting_started">Xrepo 快速上手</a>。</p>

<h3 id="支持安装交叉编译的依赖包">支持安装交叉编译的依赖包</h3>

<p>新版本中，我们改进了 xmake 内部的依赖包安装机制，增加了对交叉编译工具链的 C/C++ 依赖包安装支持，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"zlib"</span><span class="p">,</span> <span class="s2">"openssl"</span><span class="p">)</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"zlib"</span><span class="p">,</span> <span class="s2">"openssl"</span><span class="p">)</span>
</code></pre>
</div>

<p>我们上面配置了两个依赖包：zlib, openssl，然后我们切到交叉编译环境，使用 musl.cc 上的编译工具链进行编译。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f -p cross --sdk=/tmp/arm-linux-musleabi-cross
</span>in xmake-repo:
  -&gt; openssl 1.1.1h
please input: y (y/n)

  =&gt; http://zlib.net/zlib-1.2.11.tar.gz .. ok
  =&gt; download https://github.com/openssl/openssl/archive/OpenSSL_1_1_1h.zip .. ok
  =&gt; installing zlib .. ok
  =&gt; installing openssl .. ok
<span class="w">$ </span><span class="nc">xmake</span><span class="kv">
</span>[ 50%]: ccache compiling.release src/main.cpp
[ 75%]: linking.release test
[100%]: build ok!
</code></pre>
</div>

<p>xmake 就会自动拉取 zlib/openssl 源码包，然后使用 <code class="highlighter-rouge">arm-linux-musleabi-cross</code> 交叉工具链编译安装 zlib 和 openssl，安装完成后，自动集成到 test 工程参与链接直到完全编译通过。</p>

<p>当然，要让 C/C++ 支持交叉编译，首先需要维护 xmake-repo 官方仓库，增加对交叉编译的支持。目前仓库中支持交叉的 C/C++ 包还不是很多，但也已经收录了不少了，后期还会不断扩充。</p>

<p>如果要看哪些包支持交叉编译，可以直接到包仓库站点查看：<a href="https://xrepo.xmake.io/#/packages/cross">支持交叉编译的C/C++包列表</a></p>

<p>我们也可以使用新版本中提供的 xrepo 命令，直接检索指定平台支持的包（支持模糊查询）：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> search -p cross zli*
</span></code></pre>
</div>

<p>我们也欢迎大家帮忙贡献更多的包进入 <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> 官方仓库，一起完善 C/C++ 包管理生态的建设，使用户能够更加方便的使用各种依赖包，不再为各种繁琐的移植工作所困扰。</p>

<h3 id="依赖包的-license-检测机制">依赖包的 license 检测机制</h3>

<p>考虑到仓库中包各自的 license 不同，有些包也许使用后会跟用户项目的 license 冲突，因此 xmake 在新版本中增加了包依赖 license 兼容性检测机制。</p>

<p>并且新增了 <code class="highlighter-rouge">set_license</code> 接口，可以让用户设置每个 target 的 license 。</p>

<p>例如，我们集成了一个 LGPL-2.0 的包 libplist 库，但是自身项目没有任何 license 设置。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"libplist"</span><span class="p">)</span> <span class="c1">-- LGPL-2.0</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cpp"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"libplist"</span><span class="p">)</span>
</code></pre>
</div>

<p>编译的时候，就会有下面的提示，警告用户使用 libplist 有可能代码 license 冲突风险。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake
warning: target<span class="o">(</span><span class="nb">test</span><span class="o">)</span> maybe is not compatible with license<span class="o">(</span>LGPL-2.1<span class="o">)</span> of package<span class="o">(</span>libplist<span class="o">)</span>,
we can use shared libraries with LGPL-2.1 or use set_license<span class="o">()</span>/set_policy<span class="o">()</span> to modify/disable license!
</code></pre>
</div>

<p>而如果我们把项目显式通过 <code class="highlighter-rouge">set_license("LGPL-2.0")</code>，确保完全兼容，就不会再有警告信息，同样对于 <code class="highlighter-rouge">GPL</code> 相关的 license，xmake也会有对应的检测。</p>

<p>而相对比较宽松的 MIT, BSD 等 license 的包，直接集成使用，是不会有任何警告的。</p>

<p>另外，如果我们显式设置的 <code class="highlighter-rouge">set_license()</code> 和包的 license 冲突，我们也会提示警告。</p>

<h3 id="pacman-包源支持">Pacman 包源支持</h3>

<p>之前的版本，xmake 已经支持自动集成 vcpkg, conan, clib, homebrew 等第三方仓库包源，而新版本中，我们新增加了对 pacman 管理的包进行集成支持。</p>

<p>我们既支持 archlinux 上的 pacman 包安装和集成，也支持 msys2 上 pacman 的 mingw <code class="highlighter-rouge">x86_64</code>/<code class="highlighter-rouge">i386</code> 包安装和集成。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"pacman::zlib"</span><span class="p">,</span> <span class="p">{</span><span class="n">alias</span> <span class="o">=</span> <span class="s2">"zlib"</span><span class="p">})</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"pacman::libpng"</span><span class="p">,</span> <span class="p">{</span><span class="n">alias</span> <span class="o">=</span> <span class="s2">"libpng"</span><span class="p">})</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"zlib"</span><span class="p">,</span> <span class="s2">"libpng"</span><span class="p">)</span>
</code></pre>
</div>

<p>archlinux 上只需要：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake
</code></pre>
</div>

<p>msys2 上安装 mingw 包，需要指定到 mingw 平台：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake f -p mingw -a [x86_64|i386]
xmake
</code></pre>
</div>

<h3 id="强制安装任意版本的包">强制安装任意版本的包</h3>

<p>由于 xmake-repo 仓库中的包，有严格的 版本列表以及对应的 sha256 值用于下载的完整性校验，这会保证包下载的可靠性和完整性。</p>

<p>但是，也导致没法完全收录一个包的所有版本，如果有需要的版本还没被收录，一种方式就是用户自己提 pr 进 xmake-repo 仓库来增加支持对应版本。</p>

<p>还有一种方式，就是用户在 xmake.lua 配置 <code class="highlighter-rouge"><span class="p">{</span><span class="err">verify</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="err">false</span><span class="p">}</span></code> 强制跳过校验机制，这样就能够选择下载任意版本的包了。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"libcurl 7.73.0"</span><span class="p">,</span> <span class="p">{</span><span class="n">verify</span> <span class="o">=</span> <span class="kc">false</span><span class="p">})</span>
</code></pre>
</div>

<h3 id="vcpkg-包集成改进">vcpkg 包集成改进</h3>

<p>关于 vcpkg 包的依赖集成，新版本里面也做了不少的改进，不仅增加了对 windows-static-md 包的切换支持，另外我们还改进了 vcpkg 命令的自动探测机制，使得在更多的场景能够自动检测到它，而不是需要手动配置。</p>

<h3 id="自定义交叉工具链改进">自定义交叉工具链改进</h3>

<p>新版本中，我们继续对自定义工具链做了改进，使得自动检测更加的智能化，通常只需要指定 sdkdir，xmake就可以自动检测其他的配置，比如 cross 等信息，例如:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">toolchain</span><span class="p">(</span><span class="s2">"my_toolchain"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"standalone"</span><span class="p">)</span>
    <span class="n">set_sdkdir</span><span class="p">(</span><span class="s2">"/tmp/arm-linux-musleabi-cross"</span><span class="p">)</span>
<span class="n">toolchain_end</span><span class="p">()</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"apps/hello/*.c"</span><span class="p">)</span>
</code></pre>
</div>

<p>这是一个最精简的交叉工具链配置，仅仅设置了对应的sdk路径，然后通过 <code class="highlighter-rouge">set_kind("standalone")</code> 将其标记为完整独立的工具链。</p>

<p>这个时候，我们就可以通过命令行 <code class="highlighter-rouge">--toolchain=my_toolchain</code> 去手动切换到此工具链来使用。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake f --toolchain=my_toolchain
xmake
</code></pre>
</div>

<p>另外，我们还可以直接在 xmake.lua 中通过 <code class="highlighter-rouge">set_toolchains</code> 将其绑定到对应的 target 上去，那么仅仅只在编译此 target 时候，才会切换到我们自定义的工具链。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">toolchain</span><span class="p">(</span><span class="s2">"my_toolchain"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"standalone"</span><span class="p">)</span>
    <span class="n">set_sdkdir</span><span class="p">(</span><span class="s2">"/tmp/arm-linux-musleabi-cross"</span><span class="p">)</span>
<span class="n">toolchain_end</span><span class="p">()</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"apps/hello/*.c"</span><span class="p">)</span>
    <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"my_toolchain"</span><span class="p">)</span>
</code></pre>
</div>

<p>这样，我们不再需要手动切换工具链了，只需要执行 xmake，就会默认自动切换到 my_toolchain 工具链。</p>

<p>这对于嵌入式开发来讲尤其有用，因为嵌入式平台的交叉编译工具链非常多，我们经常需要各种切换来完成不同平台的编译。</p>

<p>因此，我们可以将所有的工具链定义放置到独立的 lua 文件中去定义，例如：</p>

<div class="highlighter-rouge"><pre class="highlight"><code>projectdir
    - xmake.lua
    - toolchains
      - my_toolchain1.lua
      - my_toolchain2.lua
      - ...
</code></pre>
</div>

<p>然后，我们只需要再 xmake.lua 中通过 includes 去引入它们，并根据不同的自定义平台，绑定不同的工具链：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">includes</span><span class="p">(</span><span class="s2">"toolchains/*.lua"</span><span class="p">)</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"apps/hello/*.c"</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">is_plat</span><span class="p">(</span><span class="s2">"myplat1"</span><span class="p">)</span> <span class="k">then</span>
        <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"my_toolchain1"</span><span class="p">)</span>
    <span class="k">elseif</span> <span class="n">is_plat</span><span class="p">(</span><span class="s2">"myplat2"</span><span class="p">)</span> <span class="k">then</span>
        <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"my_toolchain2"</span><span class="p">)</span>
    <span class="k">end</span>
</code></pre>
</div>

<p>这样，我们就可以编译的时候，直接快速切换指定平台，来自动切换对应的工具链了。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake f -p myplat1
xmake
</code></pre>
</div>

<p>如果，有些交叉编译工具链结构复杂，自动检测还不足够，那么可以根据实际情况，使用 <code class="highlighter-rouge">set_toolset</code>, <code class="highlighter-rouge">set_cross</code> 和 <code class="highlighter-rouge">set_bindir</code> 等接口，针对性的配置上其他的设置。</p>

<p>例如下面的例子，我们还额外添加了一些 cxflags/ldflags 以及内置的系统库 links。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">toolchain</span><span class="p">(</span><span class="s2">"my_toolchain"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"standalone"</span><span class="p">)</span>
    <span class="n">set_sdkdir</span><span class="p">(</span><span class="s2">"/tmp/arm-linux-musleabi-cross"</span><span class="p">)</span>
    <span class="n">on_load</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">toolchain</span><span class="p">)</span>
        <span class="c1">-- add flags for arch</span>
        <span class="k">if</span> <span class="n">toolchain</span><span class="p">:</span><span class="n">is_arch</span><span class="p">(</span><span class="s2">"arm"</span><span class="p">)</span> <span class="k">then</span>
            <span class="n">toolchain</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"cxflags"</span><span class="p">,</span> <span class="s2">"-march=armv7-a"</span><span class="p">,</span> <span class="s2">"-msoft-float"</span><span class="p">,</span> <span class="p">{</span><span class="n">force</span> <span class="o">=</span> <span class="kc">true</span><span class="p">})</span>
            <span class="n">toolchain</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"ldflags"</span><span class="p">,</span> <span class="s2">"-march=armv7-a"</span><span class="p">,</span> <span class="s2">"-msoft-float"</span><span class="p">,</span> <span class="p">{</span><span class="n">force</span> <span class="o">=</span> <span class="kc">true</span><span class="p">})</span>
        <span class="k">end</span>
        <span class="n">toolchain</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"ldflags"</span><span class="p">,</span> <span class="s2">"--static"</span><span class="p">,</span> <span class="p">{</span><span class="n">force</span> <span class="o">=</span> <span class="kc">true</span><span class="p">})</span>
        <span class="n">toolchain</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"syslinks"</span><span class="p">,</span> <span class="s2">"gcc"</span><span class="p">,</span> <span class="s2">"c"</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>更多自定义工具链的例子，可以到 xmake 的源码的目录参考内置的工具链定义：<a href="https://github.com/xmake-io/xmake/blob/master/xmake/toolchains/">内部工具链列表</a></p>

<h3 id="菜单配置支持鼠标操作">菜单配置支持鼠标操作</h3>

<p>还记得 xmake 还有提供终端图形化的菜单配置么？就是类似 linux kernel 的经典 menu config 图形化配置界面。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>xmake f --menu
</code></pre>
</div>

<p>新版本中，我们也对它做了进一步的改进，增加的跨平台的鼠标操作，我们可以用鼠标来进行各种配置项的点击和选择操作，更加的方便。</p>

<p><img src="https://xmake.io/assets/img/index/menuconf.png" width="650px" /></p>

<h2 id="更新内容">更新内容</h2>

<h3 id="新特性">新特性</h3>

<ul>
  <li>添加新的 <a href="https://github.com/xmake-io/xrepo">xrepo</a> 命令去管理安装 C/C++ 包</li>
  <li>支持安装交叉编译的依赖包</li>
  <li>新增musl.cc上的工具链支持</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1009">#1009</a>: 支持忽略校验去安装任意版本的包，<code class="highlighter-rouge">add_requires("libcurl 7.73.0", {verify = false})</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1016">#1016</a>: 针对依赖包增加license兼容性检测</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1017">#1017</a>: 支持外部/系统头文件支持 <code class="highlighter-rouge">add_sysincludedirs</code>，依赖包默认使用<code class="highlighter-rouge">-isystem</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1020">#1020</a>: 支持在 archlinux 和 msys2 上查找安装 pacman 包</li>
  <li>改进 <code class="highlighter-rouge">xmake f --menu</code> 菜单配置，支持鼠标操作</li>
</ul>

<h3 id="改进">改进</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/997">#997</a>: <code class="highlighter-rouge">xmake project -k cmake</code> 插件增加对 <code class="highlighter-rouge">set_languages</code> 的支持</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/998">#998</a>: 支持安装 windows-static-md 类型的 vcpkg 包</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/996">#996</a>: 改进 vcpkg 目录查找</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1008">#1008</a>: 改进交叉编译工具链</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1030">#1030</a>: 改进 xcode.framework and xcode.application 规则</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1051">#1051</a>: 为 msvc 编译器添加 <code class="highlighter-rouge">edit</code> 和 <code class="highlighter-rouge">embed</code> 调试信息格式类型到 <code class="highlighter-rouge">set_symbols()</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1062">#1062</a>: 改进 <code class="highlighter-rouge">xmake project -k vs</code> 插件</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="english">English</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/2020/11/24/xmake-update-v2.3.9/">xmake v2.3.9 released, Add independent Xrepo C/C++ package manager
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        
            </ul>
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2020/11/15/xrepo-new-command/">Xrepo：一个现代化的跨平台 C/C++ 包管理器</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2020/11/30/ltui-v2.4/">LTUI v2.4 发布, 一个基于lua的跨平台字符终端UI界面库</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
